<template>
  <div class="onebox">
    <div class="index_one">
      <div class="index_one_top index_part_title">
        <i class="el-icon-s-custom"></i>
        <span>会员注册量</span>
        <i class="el-icon-refresh refresh" @click="refresh"></i>
      </div>
      <div class="index_one_bottom" @click="$router.push('/index/user')">
        <p>{{ data["会员注册量"] }}</p>
        <p>
          会员注册量
          <span>
            {{ data["昨日注册量"] }}
          </span>
        </p>
        <p><span>今日注册量</span> {{ data["今日注册量"] }}</p>
      </div>
    </div>
    <div class="index_one">
      <div class="index_one_top index_part_title">
        <i class="el-icon-s-custom"></i>
        <span>成交会员量</span>
        <i class="el-icon-refresh refresh" @click="refresh"></i>
      </div>
      <div class="index_one_bottom" @click="$router.push('/index/user')">
        <p>{{ data["总成交会员量"] }}</p>
        <p>
          总成交会员量
          <span>
            {{ data["昨日成交会员量"] }}
          </span>
          <span style="margin: 0 6px">|</span>
          <span>
            转化率
            <b>{{ data["成交会员量转化率"] }}</b>
            <i
              :class="[
                Number(data['成交会员量转化率']) > 0
                  ? 'el-icon-caret-top'
                  : 'el-icon-caret-bottom',
              ]"
            />
          </span>
        </p>
        <p><span>今日成交会员量</span> {{ data["今日成交会员量"] }}</p>
      </div>
    </div>
    <div class="index_one">
      <div class="index_one_top index_part_title">
        <i class="el-icon-s-custom"></i>
        <span>订单量</span>
        <i class="el-icon-refresh refresh" @click="refresh"></i>
      </div>
      <div class="index_one_bottom" @click="$router.push('/index/order')">
        <p>{{ data["总订单量"] }}</p>
        <p>
          总订单量
          <span>{{ data["昨日订单量"] }}</span>
        </p>

        <p><span>今日订单量</span> {{ data["今日订单量"] }}</p>
      </div>
    </div>
    <div class="index_one">
      <div class="index_one_top index_part_title">
        <i class="el-icon-s-custom"></i>
        <span>营业额</span>
        <i class="el-icon-refresh refresh" @click="refresh"></i>
      </div>
      <div class="index_one_bottom" @click="$router.push('/index/user/money')">
        <p>{{ data["总营业额"] }}</p>
        <p>
          总营业额
          <span>{{ data["昨日营业额"] }}</span>
          <span style="margin: 0 6px">|</span>
          <span
            >客单价：
            <b style="color: #ed4014">{{ data["营业额客单价"] }}</b></span
          >
        </p>
        <p><span>今日营业额</span> {{ data["今日营业额"] }}</p>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {};
  },
  props: {
    data: {
      type: Object,
      default: () => ({}),
    },
  },
  components: {},
  methods: {
    refresh() {
      this.$bus.$emit("refresh", "mail");
    },
  },
};
</script>
<style lang="less" scoped>
.onebox {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
}
.index_one:not(:last-child) {
  margin-right: 15px;
}
.el-icon-caret-top {
  color: #ed4014 !important;
}
.el-icon-caret-bottom {
  color: #2fbe6b !important;
}

.index_one {
  flex: 1;
  border-radius: 5px;
  background-color: #ffffff;
  -moz-box-shadow: 0px 5px 20px #e4e4e4;
  -webkit-box-shadow: 0px 5px 20px #e4e4e4;
  box-shadow: 0px 5px 20px #e4e4e4;
  .index_one_bottom {
    width: 100%;
    height: 140px;
    display: flex;
    flex-flow: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 0 15px;
    > p:nth-of-type(1) {
      font-size: 30px;
      font-weight: bold;
      height: 60px;
      line-height: 70px;
    }
    > p:nth-of-type(2) {
      width: 100%;
      font-size: 15px;
      height: 30px;
      display: flex;
      flex-wrap: nowrap;
      justify-content: flex-end;
      align-items: center;
      padding-bottom: 10px;
      color: #212121;
      > span {
        font-size: 14px;
        color: #212121;
      }
      > span:nth-of-type(1) {
        margin-left: auto;
        i {
          color: #ed4014;
        }
      }
      > span:nth-of-type(2) {
        i {
          color: #2fbe6b;
        }
      }
    }
    > p:nth-of-type(3) {
      width: 100%;
      color: #212121;
      flex: 1;
      display: flex;
      flex-wrap: nowrap;
      justify-content: flex-start;
      align-items: center;
      border-top: 1px solid #e8eaec;
      > span:nth-of-type(1) {
        margin-right: auto;
      }
    }
  }
}
</style>
